1. Field of the Invention
The present invention is related to the field of computer systems. More particularly, the present invention is a method and apparatus for aligning a restored parent environment to its child environments with minimal data loss.
2. Art Background
Today, many computer systems offer support for hierarchies of inter-related environments for software development. For example, the Network Software Environment (NSE) supported on the SUN microsystems manufactured by SUN Microsystems, Inc., Mountain View, Calif. An environment 20 or 21 is a named envelope of a collection of objects 24, 26 or 25, 27 (FIG. 1a). Typically, the objects are organized under a directory 22 or 23. An environment 20 or 21 may be created on any machine 12, 14, 16 or 18 in a network of computers 10. An object 24, 25, 26 or 27 is a named data container. An object 24, 25, 26 or 27 may be a simple object 26 or 27 or a compound object 24 or 25. A simple object 26 or 27, is an object that does not contain other objects, for example, a source file. A compound object 24 or 25 is a list of other objects, including other compound objects, for example, a component containing a list of its source files. The objects 24, 25, 26, 27 of an environment 20, 21 may be physically located on any machine 12, 14, 16 or 18 in the network of computers 10.
Typically, environments 31-36 are logically organized into an hierarchy 30 (FIG. 1b). For example, a software development project may comprise a grand-parent release environment 31 for holding the various revisions of the project 40 that have been released to the customers, a plurality of parent integration environments 32, 33, each holding the latest revisions of component 41 or 42 of the project, and a plurality of child development environments 34, 35, 36, each holding the latest editions of various subcomponents 43-46 being modified by the individual developers.
A developer who wish to modify an object acquires a new edition of the object 52 or 53 into the child environment from the latest revision of the object 51 in the parent environment (FIG. 2). After modifying the new edition of the object 52 or 53 in the child environment, the latest revision of the object 51 or 56 in the parent environment is reconciled to the modified edition of the object 54 or 55 in the child environment. If the latest revision of the object 51 in the parent environment is the same revision of the object 51 in the parent environment previously acquired for the modified edition of the object 54 in the child environment, the reconciliation process is successful, resulting in a new latest revision of the object 56 being made in the parent environment.
If the latest revision of the object 56 in the parent environment is not the same revision of the object 51 in the parent environment previously acquired for the modified edition of the object 55 in the child environment, the reconciliation process is unsuccessful, resulting in the initiation of the resynchronization process and acquisition of a new edition of the object 57 into the child environment from the new latest revision of the object 56 in the parent environment. After resolving the differences between the modified edition of the object 55 and the acquired new edition of the object 57, the latest revision of the object 56 in the parent environment is reconciled again to the consolidated edition of the object 58 in the child environment. Since the latest revision of the object 56 in the parent environment has remained unchanged, the reconciliation process is successful, resulting in another new latest revision of the object 59 being made in the parent environment.
For the environments to work cooperatively with each other, each environment contains a plurality of internal files (not shown in FIGS. 1a, 1b and 2) for keeping track of status and attribute information regarding the objects. Thus, consistency between these internal files must be maintained, in order for the environment hierarchy to work properly. The environments are said to be aligned if consistency is maintained.
Ideally, these environments are all backed up at the same time, when they are all quiescent. But, in practice, particularly for large software development projects, it is often impossible to do so. The environments tend to be backed up at different times. Furthermore, other environments tend to be active when a quiescent environment is being backed up. Therefore, when damages occur to one or more of the environments, restoration of the damaged environments, and aligning the restored environments to the other environments, without substantial data loss, becomes a problem.
The problem tends to be more tolerable if the damages are confined to the leaf environments. A leaf environment is a child environment that is not a parent environment to other child environments. Typically, a damaged leaf environment is restored to its last back up. Since after the restoration, all objects in a restored leaf environment would be older in time than their corresponding revisions in the parent environment, the restored leaf environment is automatically in alignment with its parent environment. Changes previously made to objects in the restored leaf environment, from the time the restored leaf environment was last backed up to the time the restored leaf environment was damaged, are lost, unless the prior changes can be recovered from the parent environment. Such changes are recoverable, only if the corresponding revisions in the parent environment were previously reconciled to the objects in the restored leaf environment, between the time the restored leaf environment was last backed up and the time the restored leaf environment was damaged.
The problem is a lot less tolerable when damages are not confined to the leaf environments. After a non-leaf environment is restored, since the objects in the child environments to the restored non-leaf environment would be younger than the corresponding revisions in the restored non-leaf environment, the restored non-leaf environment is most likely no longer in alignment with its child environments. To return the environment hierarchy into alignment, all the child environments to the restored non-leaf environment has to be restored to previous back up times that are older than the back up time of the damaged non-leaf environment being restored to. Similarly, if the restored child environments themselves are parent environments to other child environments (grand-child environment to the damaged non-leaf environment), these other child environments (grand-child environment to the damaged non-leaf environment) also have to be restored to previous back up times that are older than the corresponding back up times of their parent environments (child environments to the damaged environment). Although similar to restoring a leaf environment, for those objects in a child environment whose corresponding revisions in their parent environment have been previously reconciled, between the time the restored child environment was backed up and the time the restored parent environment was backed up, prior changes made to these objects between these times are recoverable; nevertheless, the amount of data loss could be substantial, due to the multiplying effect for each layer of the environment hierarchy that has to be restored.